import request from '@/utils/request';
import { stringify } from 'qs';

const api = '/api/System';

export async function backupDatabase() {
  const url = `${api}/BackupDatabase`;
  return request(url);
}

export async function getBackupList() {
  const url = `${api}/GetBackupList`;
  return request(url);
}

export async function downloadBackupFile(fileName) {
  const url = `${api}/DownloadBackupFile?fileName=${fileName}`;
  return request(url, { responseType: 'blob' });
}

export async function clearBackupFiles() {
  const url = `${api}/ClearBackupFiles`;
  return request(url);
}